Installing BAT
The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to execute API tests.
Prerequisite for Linux and MacOS Systems
Before installing the BAT CLI, ensure that Java 17 is installed on your system.
Prerequisites for Windows 10 Systems
-
Install Windows Subsystem for Linux (WSL)
The instructions are at https://learn.microsoft.com/en-us/windows/wsl/install.
-
Install Java 17, curl, and the application "unzip" into the Linux distribution that you installed in your WSL.
-
Ensure that the
JAVA_HOMEvariable in your environment is set to the location of your Java installation. -
Add the
batexecutable to yourPATHenvironment variable:-
Open the
~/.bashrcfile (if you are usingbash) or the~/.zshrcfile (if you are usingzsh) for editing. For example, to use thevieditor, enter either of these commands:vi ~/.bashrcvi ~/.zshrc -
Add the following line to the end of the file and then save the file:
export PATH=$PATH:~/.bat/bat/bin
-
Install BAT
You can install BAT CLI on Linux, MacOS, and Windows.
Linux and MacOS Systems
-
Ensure that the user under which you are installing has write and execute permissions for the directory into which you plan to install BAT CLI and to
/usr/local/bin. -
Run the following command to install BAT CLI:
curl -o- 'https://s3.amazonaws.com/bat-wrapper/install.sh' | bashThis installs BAT CLI into the
$HOME/.bat/bat/bindirectory. The installation script automatically adds abatfile to the/usr/local/bindirectory that points to the actual BAT CLI installation directory. If this does not work, you can manually add$HOME/.bat/bat/binto your shell environment’s path to execute BAT CLI or rerun the installation under a user with write permission for/usr/local/bin. -
Run the command
bat -versionto verify that BAT CLI is installed.
Windows
-
Click here to automatically download the ZIP file of the BAT wrapper for Windows.
-
Unzip the ZIP file to install BAT CLI in your Windows environment.
-
Run the command
bat -versionto verify that BAT CLI is installed.



